import {BaseHttpService, HttpCustomConfig} from "../base/base.http.service";
import {Observable} from "rxjs";
import {NzSafeAny} from "ng-zorro-antd/core/types";
import {Injectable} from "@angular/core";

@Injectable({
  providedIn: 'root'
})
export class ProductHttpService {

  constructor(public http: BaseHttpService) {
  }

  public addCouponProduct(params: NzSafeAny, config: HttpCustomConfig): Observable<NzSafeAny> {
    return this.http.post(this.http.getUrl('/adminProduct/addCouponProduct', false), params, config);
  }

  public queryProduct(params: NzSafeAny, config: HttpCustomConfig): Observable<NzSafeAny> {
    return this.http.post(this.http.getUrl('/adminProduct/queryProduct', false), params, config);
  }

  public updatePrice(params: NzSafeAny, config: HttpCustomConfig): Observable<NzSafeAny> {
    return this.http.post(this.http.getUrl('/adminProduct/updatePrice', false), params, config);
  }

  public updateStatus(params: NzSafeAny, config: HttpCustomConfig): Observable<NzSafeAny> {
    return this.http.post(this.http.getUrl('/adminProduct/updateStatus', false), params, config);
  }

  public updateDesc(params: NzSafeAny, config: HttpCustomConfig): Observable<NzSafeAny> {
    return this.http.post(this.http.getUrl('/adminProduct/updateDesc', false), params, config);
  }

  public updateStock(params: NzSafeAny, config: HttpCustomConfig): Observable<NzSafeAny> {
    return this.http.post(this.http.getUrl('/adminProduct/updateStock', false), params, config);
  }
}
